﻿@model List<Feedback>
@{
    Layout = null;
    Sysconfig config = ViewData["config"] as Sysconfig;
}
<!DOCTYPE html>
<!--HTML5 doctype-->
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <title>留言反馈</title>
    <link rel="stylesheet" type="text/css" href="/mobile/css/validate.css" />
    <link rel="stylesheet" type="text/css" href="/mobile/css/style.css" />
    <script type="text/javascript" charset="utf-8" src="/mobile/js/zepto.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="/mobile/js/weui.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="/mobile/js/common.js"></script>
    <script type="text/javascript" charset="utf-8" src="/mobile/js/mvalidate.js"></script>
    <script type="text/javascript" charset="utf-8" src="/mobile/js/mvalidate-extend.js"></script>
    <script type="text/javascript" charset="utf-8" src="~/mobile/js/register-validate.js"></script>
    <script type="text/javascript">
        $(function () {
            //初始化发表留言表单
            AjaxInitForm('#feedbackForm', '#btnSubmit', 1);
        });
    </script>
</head>

<body ontouchstart>
    <div class="page">
        <!--页面头部-->
        <div class="header">
            <a class="back" href="javascript:history.back();">
                <i class="iconfont icon-arrow-left"></i>
            </a>
            <h3>留言反馈</h3>
            <div class="right">
                <a class="weui-cell_access weui-cell_link" asp-area="Web" asp-controller="Index" asp-action="Index">
                    <i class="iconfont icon-home"></i>
                </a>
            </div>
        </div>
        <!--/页面头部-->
        <!--页面内容-->
        <div class="page__bd">

            <!--留言列表-->
            <div class="weui-panel weui-panel_access" style="margin-top:10px;">
                <div class="weui-panel__hd">留言列表</div>
                <div class="weui-panel__bd">
                    <div class="comment-box">
                        <ol class="comment-list">
                            @foreach (Feedback item in Model)
                            {
                            <li>
                                <div class="avatar">
                                    <i class="iconfont icon-user-full"></i>
                                </div>
                                <div class="inner">
                                    <div class="meta">
                                        <span class="blue">@item.user_name</span>
                                        <span class="time">@item.add_time</span>
                                    </div>
                                    <p>@Html.Raw(item.content)</p>
                                </div>

                                @if (!string.IsNullOrEmpty(item.reply_content))
                                {
                                    <div class="answer">
                                        <div class="meta">
                                            <span class="time">@item.reply_time</span>
                                            <span class="blue">管理员回复：</span>
                                        </div>
                                        <p>@Html.Raw(item.reply_content)</p>
                                    </div>
                                }
                                </li>
                            }
                            @if (Model.Count == 0)
                            {
                                <div class="nodata">暂无记录...</div>
                            }
                        </ol>
                    </div>                    
                </div>
            </div>
            <!--/留言列表-->
            <!--分页页码-->
            <div class="page-list">
                @Html.Raw(ViewBag.pagelist)
            </div>
            <!--/分页页码-->
            <!--发表留言-->
            <form id="feedbackForm" name="feedbackForm" class="form-box" url="/submit_ajax?action=feedback_add">
                <div class="weui-panel weui-panel_access">
                    <div class="weui-panel__hd">发表留言</div>
                    <div class="weui-panel__bd">
                        <div class="weui-cells_form form-box">

                            <div class="weui-cell">
                                <div class="weui-cell__hd">
                                    <label class="weui-label">用户昵称</label>
                                </div>
                                <div class="weui-cell__bd">
                                    <input id="txtUserName" name="txtUserName" class="weui-input" type="text" placeholder="请输入昵称" data-validate="s" />
                                </div>
                            </div>

                            <div class="weui-cell">
                                <div class="weui-cell__hd">
                                    <label class="weui-label">联系电话</label>
                                </div>
                                <div class="weui-cell__bd">
                                    <input id="txtUserTel" name="txtUserTel" class="weui-input" type="tel" placeholder="联系电话，非必填" />
                                </div>
                            </div>

                            <div class="weui-cell">
                                <div class="weui-cell__hd">
                                    <label class="weui-label">QQ号码</label>
                                </div>
                                <div class="weui-cell__bd">
                                    <input id="txtUserQQ" name="txtUserQQ" class="weui-input" type="text" placeholder="QQ号码，非必填" />
                                </div>
                            </div>

                            <div class="weui-cell">
                                <div class="weui-cell__hd">
                                    <label class="weui-label">电子邮箱</label>
                                </div>
                                <div class="weui-cell__bd">
                                    <input id="txtUserEmail" name="txtUserEmail" class="weui-input" type="text" placeholder="邮箱地址，非必填" />
                                </div>
                            </div>

                            <div class="weui-cell">
                                <div class="weui-cell__hd">
                                    <label class="weui-label">留言标题</label>
                                </div>
                                <div class="weui-cell__bd">
                                    <input id="txtTitle" name="txtTitle" class="weui-input" type="text" placeholder="请输入留言标题" data-validate="s" />
                                </div>
                            </div>

                            <div class="weui-cell">
                                <div class="weui-cell__bd">
                                    <textarea id="txtContent" name="txtContent" class="weui-textarea" placeholder="请输入留言内容" rows="3" data-validate="comment"></textarea>
                                </div>
                            </div>

                            <div class="weui-cell">
                                <div class="weui-cell__hd">
                                    <label class="weui-label">验证码</label>
                                </div>
                                <div class="weui-cell__bd">
                                    <input id="txtCode" name="txtCode" class="weui-input" type="text" placeholder="请输入验证码" data-validate="code" />
                                </div>
                                <div class="weui-cell__ft">
                                    <a href="javascript:;" onclick="ToggleCode(this, '/verify_code/index');return false;">
                                        <img class="weui-vcode-img" src="/verify_code/index" style="width:82px;height:24px;" />
                                    </a>
                                </div>
                            </div>

                        </div>

                    </div>
                </div>
                <div class="weui-btn-area">
                    <input id="btnSubmit" name="btnSubmit" type="submit" class="weui-btn weui-btn_primary" value="发表留言" />
                </div>
            </form>
            <!--/发表留言-->
            <!--版权信息-->
            @await Html.PartialAsync("~/Areas/Web/Views/Shared/_Copyright.cshtml")
            <!--/版权信息-->
            <!--底部导航-->
            @await Html.PartialAsync("~/Areas/Web/Views/Shared/_Footer.cshtml")
            <!--/底部导航-->

        </div>
        <!--/页面内容-->

    </div>
</body>
</html>
